package com.runlooker.runer.entity;

import net.tsz.afinal.annotation.sqlite.Id;
import net.tsz.afinal.annotation.sqlite.Table;

import com.runlooker.runer.db.RunerTableSql;

/**
 * @author YINENG
 * 
 */

@Table(name = RunerTableSql.MESSAGE_ENTRY_TABLE)
public class ChatMsgEntity {
	// 播放状态
	public static final int PLAY_ING = 1;
	public static final int PLAY_END = 0;

	// 消息类型
	public static final int COMMON_MESSAGE = 0;// 普通消息
	public static final int RECORD_FILE = 1;// 录音文件
	public static final int IAMGE_FILE = 2;// 图片

	/**
	 * 聊天类型
	 */
	public static final int PERSON_CHAT = 0;// 私聊
	public static final int GROUP_CHAT = 1;// 群聊

	/**
	 * 本地消息是否已读
	 */
	public static final int IS_READ = 1;// 已读
	public static final int IS_NOT_READ = 0;// 未读

	/**
	 * 消息来源
	 */
	public static final int IS_COME_MSG = 0;// 接收到的消息
	public static final int IS_SEND_MSG = 1;// 发送的消息

	/**
	 * 消息发送状态
	 */
	public static final int SENDED_FAILED = 0;// 发送失败
	public static final int SENDED_SUCCESS = 1;// 发送成功
	public static final int SENDED_ING = 2;// 发送中

	/**
	 * 消息对应的id(消息流id)
	 */
	@Id(column = "packetId")
	private String packetId;

	/**
	 * 对方的帐号
	 */
	private String chatAccount;
	/**
	 * 消息发送或接收时间,对应的值是毫秒
	 */
	private String time;

	/**
	 * 消息文本
	 */
	private String message;
	/**
	 * IS_READ表示消息已读,IS_NOT_READ标识消息未读，如果帐号是当前用户，则消息默认为已读
	 */
	private int isReaded;
	/**
	 * SENDED_SUCCESS 标识消息发送成功,SENDED_FAILED表示消息发送失败，SENDED_ING表示发送中
	 */
	private int isSended;

	/**
	 * IS_COME_MSG 表示消息是别人发送给自己的，IS_SEND_MSG表示消息是自己发送出去的
	 */
	private int msgSourse;

	/**
	 * 消息类型，0普通消息，1录音文件，2图片
	 */
	private int msgType;

	/**
	 * 文件的描述，json字符串
	 */
	private String description;

	private int voicePlayStatus = PLAY_END;// 语音播放状态，0为停止播放，1为播放中

	/**
	 * 群聊时，群的id
	 */
	private int groupId = -1;

	/**
	 * 聊天类型PERSON_CHAT,GROUP_CHAT;
	 */
	private int chatType;

	private String fileName;

	/**
	 * 原图地址
	 */
	private String path;

	public String getPath() {
		return path;
	}

	public void setPath(String path) {
		this.path = path;
	}

	public String getFileName() {
		return fileName;
	}

	public void setFileName(String fileName) {
		this.fileName = fileName;
	}

	public int getChatType() {
		return chatType;
	}

	public void setChatType(int chatType) {
		this.chatType = chatType;
	}

	public int getGroupId() {
		return groupId;
	}

	public void setGroupId(int groupId) {
		this.groupId = groupId;
	}

	public int getVoicePlayStatus() {
		return voicePlayStatus;
	}

	public void setVoicePlayStatus(int voicePlayStatus) {
		this.voicePlayStatus = voicePlayStatus;
	}

	public String getDescription() {
		return description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	public int getMsgType() {
		return msgType;
	}

	public void setMsgType(int msgType) {
		this.msgType = msgType;
	}

	public int getMsgSourse() {
		return msgSourse;
	}

	public void setMsgSourse(int msgSourse) {
		this.msgSourse = msgSourse;
	}

	public int getIsSended() {
		return isSended;
	}

	public void setIsSended(int isSended) {
		this.isSended = isSended;
	}

	public int getIsReaded() {
		return isReaded;
	}

	public void setIsReaded(int isReaded) {
		this.isReaded = isReaded;
	}

	public String getMessage() {
		return message;
	}

	public void setMessage(String message) {
		this.message = message;
	}

	public String getTime() {
		return time;
	}

	public void setTime(String time) {
		this.time = time;
	}

	public String getChatAccount() {
		return chatAccount;
	}

	public void setChatAccount(String chatAccount) {
		this.chatAccount = chatAccount;
	}

	public String getPacketId() {
		return packetId;
	}

	public void setPacketId(String packetId) {
		this.packetId = packetId;
	}

}
